<template>
  <div> 
      <h3>注册协议</h3>
      <quill-editor ref="myTextEditor" v-model.trim="text"></quill-editor>
      <div class="oks" @click="isOk()">确定</div>
  </div>
</template>


<script>
import { quillEditor } from 'vue-quill-editor'
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
export default {
  data() {
    return { 
        text: ''
    };
  },
  components: {
    quillEditor
  },
  created() {
      this.fenXiang()
  },
  methods: { 
   //协议回显
    fenXiang() {
      let url = "/config/get/RA";
      this.httpPost(url,{key:'RA'}, res => {
        if (res.code == 200) {
            this.text = res.data.val
        }
      });
    },  
    //确定
    isOk(){
        let self = this
        console.log( this.text)
        let url = "/config/put";
        this.httpPost(url,{key:'RA',val:this.text}, res => {
            if (res.code == 200) {
                self.$message({
                    message: '操作成功',
                    type: 'success'
                });
                self.fenXiang()
            }
        });
    }
  }
};
</script>

<style lang="scss" scoped>
h3{
    text-align: center;
    line-height: 50px;
}
.oks{
    margin: 20px auto;
    width: 100px;
    text-align: center;
    background: #409eff;
    line-height: 40px;
    color: #fff;
    border-radius: 5px;
    cursor: pointer;
}
</style>
<style>
    .ql-editor{
        min-height: 300px;
    }
    .ql-video{
        display: none!important;
    }
</style>
